﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ViewExportAttribute.cs" company="http://buginbox.wordpress.com/">
//   Copyright (c) GNU General Public License version 2 (GPLv2)
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

using System;
using System.ComponentModel.Composition;

namespace Wpf.Core.Behavior
{
    /// <summary>
    /// Attribut pour définir l'association d'un control à une région PRISM
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    [MetadataAttribute]
    public class ViewExportAttribute : ExportAttribute, IViewRegionRegistration
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ViewExportAttribute"/> class.
        /// </summary>
        public ViewExportAttribute() : base(typeof(object))
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ViewExportAttribute"/> class.
        /// </summary>
        /// <param name="viewName">
        /// The view name. 
        /// </param>
        public ViewExportAttribute(string viewName) : base(viewName, typeof(object))
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="ViewExportAttribute"/> class.
        /// </summary>
        /// <param name="viewName">
        /// The view name. 
        /// </param>
        /// <param name="type">
        /// The type. 
        /// </param>
        public ViewExportAttribute(string viewName, Type type) : base(viewName, type)
        {
        }

        /// <summary>
        /// Gets or sets RegionName.
        /// </summary>
        public string RegionName
        {
            get;
            set;
        }
    }
}